package com.chen;

import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(RegProperties.class)
public class RegAutoConfigure {

    @Autowired
    RegProperties regProperties; 


    @Bean
    RegService regService() {
        RegService regService = new RegService(regProperties.getUsername(), regProperties.getPassword());
        return regService;
    }
}
